package com.yanfan.modbus.frame;


import com.yanfan.modbus.code.FunctionCode;
import com.yanfan.modbus.exception.ModbusTransportException;
import com.yanfan.modbus.frame.abs.ReadNumericRequest;

public class ReadHoldingRegistersRequest extends ReadNumericRequest {

    public ReadHoldingRegistersRequest(int slaveId, int startOffset, int numberOfRegisters) throws ModbusTransportException {
        super(slaveId, startOffset, numberOfRegisters);
    }

    public ReadHoldingRegistersRequest(int slaveId) throws ModbusTransportException {
        super(slaveId);
    }


    @Override
    public byte getFunctionCode() {
        return FunctionCode.READ_HOLDING_REGISTERS;
    }


    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return "ReadHoldingRegistersRequest [slaveId=" + slaveId + ", getFunctionCode()=" + getFunctionCode() + ", " + super.toString() + "]";
    }
}
